import React from 'react'
import { Upload, message, Button } from 'antd';
import { UploadOutlined } from '@ant-design/icons';
const uploadprops = {
    name: 'avater',
    action: '/test',
    headers: {
        authorization: 'authorization-text',
    },
    onChange(info) {
        console.log(info)
        if (info.file.status !== 'uploading') {
            console.log(info.file, info.fileList);
        }
        if (info.file.status === 'done') {
            message.success(`${info.file.name} file uploaded successfully`);
        } else if (info.file.status === 'error') {
            message.error(`${info.file.name} file upload failed.`);
        }
    },
};
function index(props) {
    return (
        <div className="content">
            <Button className="add" onClick={()=> props.history.goBack()}>
                返回
            </Button>
            <Upload {...uploadprops}>
                <Button icon={<UploadOutlined />}>上传图片</Button>
            </Upload>,
        </div>
    )
}

export default index